int *findEvenNumbers(int *digits, int digitsSize, int *returnSize)
{
    int num[10] = {0};
    for (int i = 0; i < digitsSize; i++)
    {
        num[digits[i]]++;
    }
    int *ans = (int *)malloc(sizeof(int) * 1000);
    int idx = 0;
    for (int i = 100; i <= 998; i += 2)
    {
        int cnt[10] = {0};
        int tmp = i;
        while (tmp > 0)
        {
            int c = tmp % 10;
            if (++cnt[c] > num[c])
            {
                break;
            }
            tmp /= 10;
        }
        if (tmp == 0)
        { 
            ans[idx++] = i;
        }
    }
    *returnSize = idx;
    return ans;
}
